package com.els.factory;



import org.apache.log4j.Logger;

import com.els.ElsConnection;
import com.els.connection.ConfigElastic;

public class ElasticFactory {
	static final Logger logger=Logger.getLogger(ElasticFactory.class);
//	private static ElsConnection elsConnection;
	private static String configPath="/config.properties";
	public static ElsConnection getConnection(){
		return init();
	}
	public static ElsConnection init(){
		ElsConnection elsConnection=new ConfigElastic(configPath);
		logger.info("buildClient finished!");
		return elsConnection;
	}
	public synchronized static void setConfigPath(String configPath){
		ElasticFactory.configPath=configPath;
	}
}
